#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+5;
int n,m,last[N][2];
string ss;
bool s[N],t[N];
int cnt1,cnt2;
int f[2005][2005];
bitset<2005> dp[2005];
void dfs(int x,int y) {
	if(x==0) return ;
	dfs(f[x][y],y-1);
	if(x==n+1) return ;
	if(y>1) cout<<" ";
	cout<<x;
}
signed main(){
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>ss;
	n=ss.size();
	for(int i=1;i<=n;i++) s[i]=ss[i-1]-'0';
	cin>>ss;
	m=ss.size();
	for(int i=1;i<=m;i++) t[i]=ss[i-1]-'0';
	dp[0][0]=1;
	for(int i=1;i<=n+1;i++) {
		for(int j=1;j<=m+1;j++) {
			if(s[i]!=t[j]) continue ;
			for(int k=i-1;k>=0;k--) {
				if(dp[k][j-1]) {
					dp[i][j]=1;
					f[i][j]=k;
				}
				if(k<i-1&&s[k]!=s[k+1]) break ;
			}
		}
	}
	if(!dp[n+1][m+1]) {
		cout<<"NO\n";
		return 0;
	}
	cout<<"YES\n";
	dfs(n+1,m+1);
	return 0;
}

